package com.mmlc.meimei.lichengkongjian.mine;

import android.view.View;
import android.widget.Button;

import com.androidnetframe.httputil.BaseRequestFilterLayer;
import com.androidnetframe.responsejavabean.RequestError;
import com.mmlc.inter.InterActivity;
import com.mmlc.meimei.lichengkongjian.R;
import com.mmlc.network.filter.BindPhoneRequestFilter;
import com.mmlc.network.responsebean.BindPhoneResponseBean;

/**
 * Created by Administrator on 2016/7/19 0019.
 */
public class BindPhone extends InterActivity implements View.OnClickListener {

    @Override
    protected int initContentView() {
        return R.layout.activity_bindphone;
    }

    Button bt_bind;

    @Override
    protected void initView() {
        bt_bind = (Button) findViewById(R.id.bt_bind);

        processData();
    }

    @Override
    protected void initEvent() {

    }

    private void processData() {
        //绑定
        bt_bind.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bt_bind:
                bindPhone();
                break;
        }
    }

    private void bindPhone() {
        //校验手机号

        //发送绑定请求
        BindPhoneRequestFilter filter = new BindPhoneRequestFilter(this);
        filter.sendRequest(new BaseRequestFilterLayer.AccessResultFromFilter<BindPhoneResponseBean>() {

            @Override
            public void onSuccess(BindPhoneResponseBean result) {
                //进入个人中心列表界面
            }

            @Override
            public void onFailed(View errorLayout, RequestError serverError, int failedType) {
                //停留在原界面
            }
        });
    }

}
